ExcelReportPrepare

void ExcelReportPrepare(string excel_file, string sheet_name, int bPrint, int bClose, int year, int month, int day, int hour, int bSave);

It is a function that prints or specifies path and date of excel file before running excel. The excel report will be opened by using ExcelReportRun after using this function. (By default, the preparation file is stored in the C:/ExcelReportTemp folder.)

Parameters

excel_file - excel file name (file path name)

excel_sheet - sheet name of excel file (deprecated; only "")

bPrint - automatically print the excel file

bClose - automatically close the excel file (generally used at automatically printing or saving)

year - setting year of data

month - setting month of data

day - setting day of data

hour - setting hour of data

bSave - automatically save the excel file of which data is at setting date. (available from 9.4.0) (Caution: Script error occurs when there is no BSAVE factor from 10.3.1 Not)

(After 10.3.1, the version shall refer to the format of example 3, 4, 5.)

Return Value

None

Example 1

@ExcelReportPrepare("C:\\Report\\Test.XLS","", 1, 1, 2002,10,19,0, 0);

@ExcelReportRun();

Description: Run excel with Test.XLS file, then automatically prints with data of 2002-10-19 before it is terminated.

Example 2

@ExcelReportPrepare("C:\\Report\\Test.XLS","", 1, 1, 2002,10,19,0, 0);

@ExcelReportPrepare("C:\\Report\\Test2.XLS","", 1, 1, 2002,10,18,0, 0);

@ExcelReportRun();

Description: Run excel with Test.XLS, then automatically prints with data of 2002-10-19. And run excel with Test2.XLS, then automatically prints with data of 2002-10-18. After that, they are terminated.

Example 3

@ExcelReportPrepare("C:\\Report\\Test.XLS","", 0, 0, 2002,10,19,0,0);

@ExcelReportRun();

Description: Run excel with Test.XLS as data of 2002-10-19. (Excel does not end)

Example 4

@ExcelReportPrepare("C:\\Report\\Test.XLS","", 0, 0, $YEAR,$MONTH,$DAY,$HOUR,0);

@ExcelReportRun();

Description: Run excel with TEST.XLS as data of ($YEAR-$MONTH-$DAY $HOUR) which is set by user. ($YEAR, $MONTH, $DAY, $HOUR are analog memory tag)

Example 5

@ExcelReportPrepare("C:\\Report\\Test.XLS","", 0, 0, $YEAR,$MONTH,$DAY,$HOUR, 1);

@ExcelReportRun();

Description: Run excel with TEST.XLS as data of ($YEAR-$MONTH-$DAY $HOUR) which is set by user, then save the file at C:\ExcelReportBackup ($YEAR, $MONTH, $DAY, $HOUR are analog memory tag)

Example Download

For an example, choose "File | Restore" in the project manager for your reference.